package easy;

public class Solution_1232 {

    public boolean checkStraightLine(int[][] coordinates) {
        int sub_y = coordinates[1][1] - coordinates[0][1];
        int sub_x = coordinates[1][0] - coordinates[0][0];
        for (int i = 2; i < coordinates.length; i++) {
            int sub_y1 = coordinates[i][1] - coordinates[0][1];
            int sub_x1 = coordinates[i][0] - coordinates[0][0];
            if (sub_y * sub_x1 != sub_x * sub_y1) {
                return false;
            }
        }
        return true;
    }

    public static void main(String[] args) {
        Solution_1232 model = new Solution_1232();
        System.out.println(model.checkStraightLine(new int[][]{{1, 1}, {2, 2}, {3, 4}, {4, 5}, {5, 6}, {7, 7}}));
        System.out.println(model.checkStraightLine(new int[][]{{1, 2}, {2, 3}, {3, 4}, {4, 5}, {5, 6}, {6, 7}}));
        System.out.println(model.checkStraightLine(new int[][]{{1, 2}, {1, 3}, {1, 4}}));
        System.out.println(model.checkStraightLine(new int[][]{{1, 2}, {1, 3}, {2, 4}}));
        System.out.println(model.checkStraightLine(new int[][]{{1, 2}, {2, 2}, {3, 2}}));
        System.out.println(model.checkStraightLine(new int[][]{{1, 2}, {2, 3}, {3, 2}}));
    }
}
